package com.lh7.ledger.service.impl;


import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.lh7.ledger.mapper.LedgersMapper;
import com.lh7.ledger.pojo.LedgerRecords;
import com.lh7.ledger.pojo.Ledgers;
import com.lh7.ledger.service.ILedgersService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author lh7
 * @since 2025-07-01
 */
@Service
public class LedgersServiceImpl extends ServiceImpl<LedgersMapper, Ledgers> implements ILedgersService {

    @Autowired
    private LedgersMapper ledgersMapper;

    @Override
    public List<Ledgers> selectAll() {
        return ledgersMapper.selectList(null);
    }

    @Override
    public List<Ledgers> selectByLedgerId(Long ledgerId) {
        QueryWrapper<Ledgers> queryWrapper = new QueryWrapper<>();
        queryWrapper.eq("ledger_id", ledgerId);
        return ledgersMapper.selectList(queryWrapper);
    }
}
